//package org.forum.chat.privatechat.serverpoint;
//import java.util.HashMap;
//import java.util.Map;
//
//import javax.servlet.http.HttpSession;
//import javax.websocket.HandshakeResponse;
//import javax.websocket.server.HandshakeRequest;
//import javax.websocket.server.ServerEndpointConfig;
//
//import org.forum.domain.User;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//
//
//public class ChatServerConfigurator extends ServerEndpointConfig.Configurator{
//	
//	private Logger logger = LoggerFactory.getLogger(ChatServerConfigurator.class);
//	
//	public static final String HTTPSESSION = "http_session";
//	
//	//保存所有在线用户的HttpSession，以用户名为主键	
//	public Map<String, HttpSession> sessions = null;
//	
//	//保存所有的聊天记录,以UUID为主键
//	private Map<String, Transcript> transcripts = null;
//	
//	public ChatServerConfigurator(){
//		if(logger.isErrorEnabled()){
//			logger.debug("-------------ChatServerConfigurator Constructor------------");
//		}
//		transcripts = new HashMap<>();
//		sessions = new HashMap<>();
//	}
//
//	@Override
//	public void modifyHandshake(ServerEndpointConfig sec, HandshakeRequest request, HandshakeResponse response) {
//		HttpSession session = (HttpSession) request.getHttpSession();
//		User user = (User)session.getAttribute("user");
//		sessions.put(user.getUsername(), session);
//	}
//	
//	public Map<String, Transcript> getTranscripts(){
//		return transcripts;
//	}
//	
//	public Map<String, HttpSession> getSessions(){
//		return sessions;
//	}
//
//}
